package br.com.listadecompras.activities;

import br.com.listadecompras.model.Group;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class AdicionarGrupoActivity extends Activity {

	public static final int CODIGO_ACTIVITY = 110;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.adiciona_group);
	}
	
	public void callAddGroupMethod(View view){
		
		EditText groupName = (EditText)this.findViewById(R.id.txtTitleGroup);
		EditText groupDesc = (EditText)this.findViewById(R.id.txtDescriptionGroup);
		
		Intent retorno = new Intent();
		retorno.putExtra(Group.NOME, groupName.getText().toString());
		retorno.putExtra(Group.DESCRICAO, groupDesc.getText().toString());
		setResult(RESULT_OK, retorno);
		finish();		
	}
	
	public void callCancelMethod(View view) {
		finish();
	}
}
